using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace cb0tServer
{
    class UDPFirewallObject
    {
        public Socket sock;
        public IPEndPoint address;
        public uint spawn;
        public uint cookie;

        public UDPFirewallObject(IPEndPoint address, int spawn, uint cookie)
        {
            this.cookie = cookie;
            this.address = address;
            this.spawn = (uint)spawn;
            this.sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.sock.Blocking = false;
        }

        public void StartTest()
        {
            try
            {
                this.sock.Connect(this.address);
            }
            catch { }
        }

        public void Dispose()
        {
            try
            {
                this.sock.Disconnect(false);
            }
            catch { }

            this.sock = null;
        }
    }
}
